



import bpy
import idprop

import 全局控制.Node.插座.bl_插座基类 as 插座基类
from 节点.Core import bl_UI配色


import engine.initLIB.load_dll as engineLib
import ctypes



class C_NodeSocket_粒子(插座基类.C_Socket_基类):
	bl_label = '粒子'
	
	#m_位置 = bpy.props.FloatVectorProperty(default=(0.0, 0.0, 0.0), update=f_socketVec3Update)
	#m_速度 = bpy.props.FloatVectorProperty(default=(0.0, 0.0, 0.0), update=f_socketVec3Update)
	#m_大小 = bpy.props.FloatProperty(default=0.0, update=f_socketVec3Update)
	def __init__(self):
		super(C_NodeSocket_粒子, self).__init__()
		
	def draw(self, context, layout, node, text):
		#if self.is_output == False and self.is_linked == False :
		#	layout.prop(self, 'm_位置', icon='EMPTY_ARROWS')
		#	layout.prop(self, 'm_速度', icon='ORIENTATION_GLOBAL')
		#	layout.prop(self, 'm_大小', icon='META_DATA')
		#else:
		layout.label(text=text+':[vec3+vec3+f]', icon='MOD_PARTICLES')
		
	def draw_color(self, context, node):
		return bl_UI配色.g_矢量插座颜色
		
	def f_getData(self):
		if self.is_linked:
			return engineLib.flexCAPI.f_取物体插座数据(ctypes.c_wchar_p(self.node.id_data.name), ctypes.c_wchar_p(self.node.name), ctypes.c_wchar_p(self.identifier))
		else:
			return None
		
	def f_setData(self):
		return None












class C_NodeSocket_粒子系统(插座基类.C_Socket_基类):
	bl_label = '粒子系统'
	
	#m_位置 = bpy.props.FloatVectorProperty(default=(0.0, 0.0, 0.0), update=f_socketVec3Update)
	#m_速度 = bpy.props.FloatVectorProperty(default=(0.0, 0.0, 0.0), update=f_socketVec3Update)
	#m_大小 = bpy.props.FloatProperty(default=0.0, update=f_socketVec3Update)
	def __init__(self):
		super(C_NodeSocket_粒子系统, self).__init__()
		
	def draw(self, context, layout, node, text):
		layout.label(text='粒子系统:'+text, icon='MOD_PARTICLES')
		
	def draw_color(self, context, node):
		return bl_UI配色.g_矢量插座颜色
		
	def f_getData(self):
		if self.is_linked:
			return engineLib.flexCAPI.f_取插座数据(ctypes.c_wchar_p(self.node.id_data.name), ctypes.c_wchar_p(self.node.name), ctypes.c_wchar_p(self.identifier))
		else:
			return None
		
	def f_setData(self):
		return None








classes = (
	C_NodeSocket_粒子,
	C_NodeSocket_粒子系统,
)

def register():
	for c in classes:
		bpy.utils.register_class(c)
	pass	

def unregister():
	for c in classes:
		bpy.utils.unregister_class(c)
	pass
	


